<%--
  Created by IntelliJ IDEA.
  User: 13095
  Date: 2024/10/6
  Time: 11:15
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set value="${pageContext.request.contextPath}" var="path"></c:set>
<html>
<head>
    <jsp:include page="inc/inc.jsp"></jsp:include>
<meta charset="UTF-8">
<title>我的地址</title>
<script src="${path}/static/js/jquery-3.2.1.min.js"></script>
</head>

<body>
        <header id="site-header" class="fixed-top">
            <section class="w3l-header-4">
                <div class="container">
                    <nav class="navbar navbar-expand-lg navbar-light">
                        <h1><a class="navbar-brand" href="${path}/user/index">
                            <span>跑腿平台</span>
                        </a></h1>
                        <button class="navbar-toggler collapsed" type="button" data-toggle="collapse"
                                data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false"
                                aria-label="Toggle navigation">
                            <span class="fa icon-expand fa-bars"></span>
                            <span class="fa icon-close fa-times"></span>
                        </button>

                        <div class="collapse navbar-collapse" id="navbarNav">
                            <ul class="navbar-nav mx-lg-auto">
                                <li class="nav-item">
                                    <a class="nav-link" href="${path}/user/index">首页 </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="${path}/user/createTask">发起任务</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="${path}/user/historyOrders">我的订单</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="${path}/user/wallet">钱包</a>
                                </li>
                                <li class="nav-item active">
                                    <a class="nav-link" href="${path}/user/myAddress">地址管理</a>
                                </li>
                                <li class="nav-item" >
                                    <a class="nav-link" href="${path}/user/reviewList">我的评价</a>
                                </li>
                                <li class="nav-item" onclick="logOut()"><a class="nav-link">退出登录</a> </li>
                            </ul>
                            <ul class="navbar-nav search-right mt-lg-0 mt-2">

                                 <li class="nav-item"><a href="${path}/user/updateUserInfo"
                                                        class="btn btn-primary btn-style d-none d-lg-block btn-style mr-2"><span
                                       class="fa fa-phone mr-3" aria-hidden="true"></span>  ${sessionScope.user.phone_number}</a>
                                </li>
                            </ul>

                            <!-- search popup -->
                            <div id="search" class="pop-overlay">
                                <div class="popup">
                                    <form action="#" method="GET" class="d-sm-flex">
                                        <input type="search" placeholder="Search.." name="search" required="required"
                                               autofocus>
                                        <button type="submit">Search</button>
                                        <a class="close" href="#url">&times;</a>
                                    </form>
                                </div>
                            </div>
                            <!-- /search popup -->
                        </div>
                        <!-- toggle switch for light and dark theme -->
                        <div class="mobile-position">
                            <nav class="navigation">
                                <div class="theme-switch-wrapper">
                                    <label class="theme-switch" for="checkbox">
                                        <input type="checkbox" id="checkbox">
                                        <div class="mode-container">
                                            <i class="gg-sun"></i>
                                            <i class="gg-moon"></i>
                                        </div>
                                    </label>
                                </div>
                            </nav>
                        </div>
                    </nav>
                </div>
            </section>
        </header>
        <section class="w3l-about-breadcrumb text-left">
            <div class="breadcrumb-bg breadcrumb-bg-about py-3">
                <div class="container grid-breadcrumb">
                    <ul class="breadcrumbs-custom-path mt-md-2">
                        <li><a href="${path}/user/index">主页</a></li>
                        <li class="active"><span class="fa fa-angle-double-right mx-2" aria-hidden="true"></span>地址管理
                        </li>
                    </ul>
                </div>
            </div>
        </section>
        <div class="form-41-mian mt-5 pt-lg-5 pt-md-4">
            <span class="subhny-title text-center mb-2">地址管理</span>
                            <h3 class="hny-title text-center mb-md-5 mb-4" style="margin: 0 ; padding: 0;">地址列表</h3>
<table style="margin: 50px auto; border: 1px;">
    <tr>
        <th>城市</th>
        <th>详细地址</th>
        <th>门牌号</th>
        <th colspan="2">操作</th>
    </tr>
    <c:forEach items="${requestScope.addressList}" var="myaddress">
        <tr style="text-align: center">
            <td>${myaddress.city.name}</td>
            <td>${myaddress.address}</td>
            <td>${myaddress.doorNumber}</td>
            <td><a href="${path}/user/updateAddress?id=${myaddress.id}">修改</a></td>
            <td><a href="${path}/user/deletMyAddress?id=${myaddress.id}">删除</a></td>
        </tr>
    </c:forEach>
</table>
            <div class="container" style="align-items: center;text-align: center">
                <a  style="flex: auto" href="${path}/user/addAddress">添加地址</a>
            </div>

</div>
        <div class="container" style="height: 800px;">
        </div>
        <jsp:include page="inc/footer.jsp"></jsp:include>
</body>

</html>
